package com.knowif.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.knowif.pojo.MessageChat;
import com.knowif.service.UserChatService;

@Controller
@RequestMapping("/wechat/")
public class MessageController {
//    @Autowired
//    private SimpMessagingTemplate simpMessagingTemplate;
    @Autowired
    private UserChatService userChatService;

    @MessageMapping("insertChat")
    public void chat(@RequestBody  MessageChat messageChat){
        userChatService.addUserChat(messageChat);
    }

}
